| Total Complexity | 1 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import {Entity, Column, PrimaryGeneratedColumn, ManyToOne} from 'typeorm'; |
||
| 5 | |||
| 6 | @Entity() |
||
| 7 | export class Quote { |
||
| 8 | @PrimaryGeneratedColumn('uuid') |
||
| 9 | private id: string; |
||
| 10 | |||
| 11 | @Column({type: 'varchar', nullable: false, unique: true}) |
||
| 12 | private quoteNumber: string; |
||
| 13 | |||
| 14 | @Column({type: 'timestamp', default: () => 'CURRENT_TIMESTAMP'}) |
||
| 15 | private date: Date; |
||
| 16 | |||
| 17 | @Column({type: 'timestamp'}) |
||
| 18 | private expiryDate: Date; |
||
| 19 | |||
| 20 | @ManyToOne(type => User, {nullable: false}) |
||
| 21 | private owner: User; |
||
| 22 | |||
| 23 | @ManyToOne(type => Customer, {nullable: false}) |
||
| 24 | private customer: Customer; |
||
| 25 | |||
| 26 | @ManyToOne(type => Project, {nullable: true}) |
||
| 27 | private project: Project; |
||
| 28 | |||
| 29 | constructor( |
||
| 30 | date: Date, |
||
| 31 | expiryDate: Date, |
||
| 32 | quoteNumber: string, |
||
| 33 | owner: User, |
||
| 34 | customer: Customer, |
||
| 35 | project?: Project | null |
||
| 36 | ) { |
||
| 37 | this.date = date; |
||
| 38 | this.expiryDate = expiryDate; |
||
| 39 | this.quoteNumber = quoteNumber; |
||
| 40 | this.owner = owner; |
||
| 41 | this.customer = customer; |
||
| 42 | this.project = project; |
||
| 43 | } |
||
| 44 | |||
| 45 | public getId(): string { |
||
| 46 | return this.id; |
||
| 47 | } |
||
| 49 |